Skip to content

fix(advisory): clean staging directory on SIGINT and SIGTERM during sync - #1663

Open
Nachiket-Roy wants to merge 1 commit into
OWASP:mainfrom
Nachiket-Roy:fix/advisory-sync-staging-cleanup-on-sigint
Open

Nachiket-Roy wants to merge 1 commit into
OWASP:mainfrom
Nachiket-Roy:fix/advisory-sync-staging-cleanup-on-sigint

Conversation

@Nachiket-Roy

Copy link
Copy Markdown
Contributor

What changed and why

This pull request improves the robustness of the syncOsvAdvisories function by ensuring proper cleanup of temporary resources and signal handlers. It also adds comprehensive tests to verify these behaviors.

Resource and signal handler management:

  • Added logic in osv-sync.ts to register and remove SIGINT and SIGTERM listeners during the advisory sync process, ensuring that temporary staging directories are cleaned up if the process is interrupted by these signals.

Testing enhancements:

  • Added tests in osv-sync.test.ts to verify that signal listeners are correctly removed after sync completion or error, and that temporary directories are cleaned up if a SIGINT is received during sync.

Closes #1661

@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 43 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bd4b051 and d45e21d.

Files selected for processing: 2

  • src/advisory/osv-sync.ts
  • tests/osv-sync.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Interrupted sync (SIGINT/SIGTERM) leaves temporary staging directories on disk

1 participant